import axios from 'axios'

export default {
  async get(action, { query = {}, data = {} } = {}) {
    const response = await axios.get(action, {
      params: query,
      data
    })
    return response.data.data
  },
  async post(action, data, query = {}) {
    const response = await axios.post(action, data, {
      params: query
    })
    return response.data.data
  }
}
